
package com.shop.cereshop.commons.domain.wallet;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 钱包流水表
 * </p>
 *
 * @since 2025-08-26
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@TableName("cere_wallet_transaction")
@ApiModel(value = "WalletTransaction", description = "钱包流水表")
@AllArgsConstructor
public class WalletTransaction {

    private static final long serialVersionUID = 1L;

    /**
     * 流水ID
     */
    @ApiModelProperty(value = "流水ID")
    @NotNull(message = "流水ID不能为空")
    @TableId(value = "transaction_id", type = IdType.AUTO)
    private Long transactionId;


    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @NotNull(message = "用户ID不能为空")
    @TableField("buyer_user_id")
    private Long buyerUserId;


    /**
     * 交易类型 1-充值 2-消费 3-退款 4-提现
     */
    @ApiModelProperty(value = "交易类型 1-充值 2-消费 3-退款 4-提现")
    @NotNull(message = "交易类型 1-充值 2-消费 3-退款 4-提现不能为空")
    @TableField("transaction_type")
    private Integer transactionType;


    /**
     * 交易金额
     */
    @ApiModelProperty(value = "交易金额")
    @NotNull(message = "交易金额不能为空")
    @TableField("amount")
    private BigDecimal amount;


    /**
     * 交易前余额
     */
    @ApiModelProperty(value = "交易前余额")
    @NotNull(message = "交易前余额不能为空")
    @TableField("balance_before")
    private BigDecimal balanceBefore;


    /**
     * 交易后余额
     */
    @ApiModelProperty(value = "交易后余额")
    @NotNull(message = "交易后余额不能为空")
    @TableField("balance_after")
    private BigDecimal balanceAfter;


    /**
     * 关联订单号
     */
    @ApiModelProperty(value = "关联订单号")
    @Length(max = 64, message = "关联订单号长度不能超过64")
    @TableField(value = "order_id", condition = LIKE)
    private String orderId;


    /**
     * 交易描述
     */
    @ApiModelProperty(value = "交易描述")
    @NotEmpty(message = "交易描述不能为空")
    @Length(max = 255, message = "交易描述长度不能超过255")
    @TableField(value = "description", condition = LIKE)
    private String description;


    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 500, message = "备注长度不能超过500")
    @TableField(value = "remark", condition = LIKE)
    private String remark;


    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @NotEmpty(message = "创建时间不能为空")
    @Length(max = 20, message = "创建时间长度不能超过20")
    @TableField(value = "create_time", condition = LIKE)
    private String createTime;




}
